import React, { Component } from 'react'
import style from './index.module.scss'
import { NavLink } from 'react-router-dom'
import { Icon, Input } from 'antd';
import {
    Route,
    Redirect,
    Switch
} from 'react-router-dom'
import Tuijian from './tuijian/tuijian'

class index extends Component {

    callback(key) {
        console.log(key);
    }

    render() {
        return (
            <div>
                <header className={style.indexheader}>
                    <NavLink to="/citys" className={style.citys}>城市<Icon type="down" /></NavLink>
                    <Input
                        className={style.search}
                        placeholder="搜索您要卖的品牌，机器型号"
                        prefix={
                            <Icon type="search" style={{ color: 'rgba(0,0,0,.25)' }} />
                        }
                    />
                    <NavLink to="/gouwuche" className={style.gouwuche}><Icon type="shopping-cart" /></NavLink>
                </header>
                <nav className={style.indexnav}>
                    <ul className={style.indexnavul}>
                        <li className={style.indexnavli}>
                            <NavLink to="/index/tuijian" activeClassName={style.erjiactive0} className={style.erji0}></NavLink>
                        </li>
                        <li className={style.indexnavli}>
                            <NavLink to="/index/maishouji" activeClassName={style.erjiactive1} className={style.erji1}></NavLink>
                        </li>
                        <li className={style.indexnavli}>
                            <NavLink to="/index/maibiji" activeClassName={style.erjiactive2} className={style.erji2}></NavLink>
                        </li>
                        <li className={style.indexnavli}>
                            <NavLink to="/index/maipingban" activeClassName={style.erjiactive3} className={style.erji3}></NavLink>
                        </li>
                    </ul>
                </nav>
                <Switch>
                    <Route path="/index/tuijian" component={Tuijian} />
                    <Route path="/index/maishouji" component={Tuijian} />
                    <Route path="/index/maibiji" component={Tuijian} />
                    <Route path="/index/maipingban" component={Tuijian} />
                    <Redirect from="/index" to="/index/tuijian" exact />
                </Switch>
            </div>
        )
    }
}

export default index